<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>企业员工管理-评议状态</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="static/css/font.css">
    <link rel="stylesheet" href="static/css/xadmin.css">
    <script type="text/javascript" src="static/js/jquery-3.3.1.js"></script>
    <script type="text/javascript" src="static/lib/layui/layui.js"></script>
    <script type="text/javascript" src="static/js/xadmin.js"></script>
</head>

<body class="layui-anim layui-anim-up">

<div class="x-nav">
		<span class="layui-breadcrumb"> <a>评议状态</a> <a> <cite>评议状态查询</cite></a>
		</span> <a class="layui-btn layui-btn-small"
                   style="line-height: 1.6em; margin-top: 3px; float: right"
                   href="javascript:location.replace(location.href);" title="刷新"> <i
        class="layui-icon" style="line-height: 30px">ဂ</i></a>
</div>
<div style="text-align: center">
    <table id="demo" class="layui-table" lay-filter="demo"></table>
</div>
</body>
<script>

    layui.use(['laydate','table','util'], function(){
        var laydate = layui.laydate
            ,table = layui.table;

        var type =decodeURI(getQueryVariable("type"));//评价指标项目ID
        //第一个实例
        table.render({
            elem: '#demo'
            ,height: 'full'
            ,url: 'employeeStatus.do?type='+type
            ,page: true
            ,method: "post"
            ,initSort: {field: 'did', type: 'desc'}
            ,defaultToolbar: ['filter', 'exports', 'print']
            ,id:'demo'
            ,cols: [[ //表头
                {field:'did', rowspan:2, title: '部门 ID',  align: 'center',fixed: 'left'}
                ,{field:'dName', rowspan:2, title: '部门名称', align: 'center',fixed: 'left'}
                ,{field:'eAccount', rowspan:2, title: '工号', align: 'center',fixed: 'left'}
                ,{field: 'eName', rowspan:2, title: '姓名', align: 'center',fixed: 'left'}
                ,{field: 'eType', rowspan:2, title: '未完成类型',align: 'center',edit:'text'}
                // ,{field: 'fRmk', rowspan:2, title: '备注', align: 'center',edit:'text'}
            ]]
        });

        var $ = layui.$, active = {
            reload : function() {
                var demoReload = $('#demoReload');
                //执行重载
                table.reload('demo', {
                    where : {

                    }
                });
            }
        };
        $('.demoTable .layui-btn').on('click', function() {
            var type = $(this).data('type');
            console.log(type);
            active[type] ? active[type].call(this) : '';
        });


    });
    function getQueryVariable(variable)
    {
        var query = window.location.search.substring(1);
        var index = query.indexOf("?");
        query = query.substr(index+1,query.length);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
            var pair = vars[i].split("=");
            if(pair[0] == variable){
                console.log(pair[1]);
                return pair[1];
            }
        }
        return false;
    }
</script>
</html>
